<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php echo $this->headTitle()?>
<style>
p {line-height:12pt}
.mainTable {border-collapse: collapse;width:640px;}
.mainTable td {padding: 0cm 1.0pt; width:640px}
.childTable {width: 300px; border-collapse: collapse; text-align: center;font-family: 標楷體;font-size:12px}
.childTable h1 {font-size:18px}
.childTitle {text-align:center; height:40px; width:300px; font-size:16px; border-style: solid; border-color: windowtext; border-width: 1.5pt 1.5pt 0.75pt 1.5pt; padding: 0cm 1.4pt;}
.childTitle2 {font-size:16px; border-top: 0.75pt solid windowtext; border-right: 0.75pt solid windowtext; border-bottom: 0.75pt solid windowtext; text-align: center; padding-left:1.4pt; padding-right:1.4pt; padding-top:0cm; padding-bottom:0cm}
.border-left {border-left:1.5pt solid windowtext; border-right:0.75pt solid windowtext; border-top:0.75pt solid windowtext; border-bottom:0.75pt solid windowtext; padding-left:1.4pt; padding-right:1.4pt; padding-top:0cm; padding-bottom:0cm}
.border-center {border-width: 1.5pt 1px 0.75pt medium; border-top: 0.75pt solid windowtext; border-right: 1px solid windowtext; border-bottom: 0.75pt solid windowtext; padding: 0cm 1.4pt;}
.border-right {border-style: solid solid solid none; border-width: 1.5pt 1.5pt 0.75pt medium; border-top: 0.75pt solid windowtext; border-right: 1.5pt solid windowtext; border-bottom: 0.75pt solid windowtext; padding: 0cm 1.4pt}
.border-bottom-solid {border-bottom: 1.5pt solid windowtext;}
.saved ,.saved-memo {text-align:right;margin:3px}
</style>
<script type="text/javascript" src="<?php echo $this->js('jquery-1.3.2.min.js')?>"></script>
<script type="text/javascript">
$(document).ready(function(){
    $.each($(".score"),function(){
     var s = $(this).text();
	        if (s == '' )
	            $(this).html('-');
	        else if(s < 60)
	            $(this).html(s+'*');
	     });
    $('#clone-table').html($('#first-table tbody').clone());
    $('#clone-table .saved').html('(<?php echo $this->translate('Registry staff saved')?>)');
    $('#clone-table .saved-memo').html('<?php echo $this->translate('Registry staff saved memo')?>');

    if (window.confirm('<?php echo $this->translate("To start printing?")?>')){
        self.print();
     }
});
</script>
</head>
<body>
<table  class="mainTable">
	<tbody>
		<tr>
			<td>
<!--			左側			-->
			<table  id="first-table"  class="childTable">
			<tbody>
			<?php if ($this->currStage == 255)$cols=4;else$cols=5;?>
			<tr style='height: 30pt;'>
            <td colspan='<?php echo $cols?>'>
                <h1><?php echo $this->School['name']?></h1>
                <span style="font-size:14px"><?php echo sprintf($this->translate('%d No. %d academic year semester'),$this->Semester['year'],$this->Semester['semester'])?>
                <?php if ($this->currStage == 255):?>
                <?php echo $this->translate('whole stage score')?>
                <?php else:?>
                <?php echo sprintf($this->translate('%dth stage'),$this->currStage)?>
                <?php endif?>
                </span>
            </td>
			</tr>
			<tr style='height: 30pt;'>
            <td class="childTitle"  colspan='<?php echo $cols?>'><?php echo $this->subjectName?><?php echo $this->translate('Score list')?></td>
            </tr>
            <tr >
            <td colspan="2" rowspan="2" class="border-left"  style="width:50px">
            <p style="text-align:right"><?php echo $this->translate('stages')?></p>
            <p style="text-align:center"><?php echo $this->translate('score')?></p>
            <p style="text-align:left"><?php echo $this->translate('student name')?></p>
            </td>
            <?php if($this->currStage == 255):?>
            <td colspan="2" class="border-right" ><?php echo $this->translate('whole stage score')?></td>
            </tr>
            <tr>
            <td class="border-center"><?php echo $this->translate('Regular Assessment')?></td>
            <?php else:?>
            <td colspan="3" class="border-right" ><?php echo sprintf($this->translate('%dth stage'),$this->currStage)?></td>
            </tr>
            <tr>
            <td class="border-center"><?php echo $this->translate('Regular Assessment')?></td>
            <td class="border-center"><?php echo $this->translate('Examined daily')?></td>
            <?php endif;?>
            <td class="border-right"><?php echo $this->translate('memo')?></td>
            </tr>
            <?php $i=0;?>
            <?php foreach($this->students as $sn=>$val):?>
            <?php if ($i++%5 == 4 or $i==count($this->students))$bt=' border-bottom-solid';else $bt=''?>
            <tr>
            <td class="border-left<?php echo $bt?>"><?php echo $val['number']?></td>
            <td class="border-center<?php echo $bt?>"><?php echo $val['name']?></td>
            <?php if($this->currStage == 255):?>
            <td class="score border-center<?php echo $bt?>"><?php echo $this->scores[$sn][3]?></td>
            <?php else:?>
            <td class="score border-center<?php echo $bt?>"><?php echo $this->scores[$sn][1]?></td>
            <td class="score border-center<?php echo $bt?>"><?php echo $this->scores[$sn][2]?></td>
            <?php endif?>
            <td class="border-right<?php echo $bt?>"></td>
            </tr>
            <?php endforeach?>
            <tr>
            <td align='left' colspan='<?php echo $cols?>'><br />
            <?php echo $this->translate('teacher sign')?>
            <u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u><br />
            <p class="saved">(<?php echo $this->translate('teacher saved')?>)</p>
            <p class="saved-memo"><?php echo $this->translate('teacher sign memo')?></p>
            </td>
            </tr>
			</tbody>
			</table>
			</td>
		       <td style="width:20px">&nbsp;</td>
		       <td style="border-left:thin dotted #000;"></td>
<!--			右側-->
			<td>
			<table id="clone-table" class="childTable">

            </table>
			</td>
		</tr>
	</tbody>
</table>
</body>
</html>